using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Model.Enum;

namespace SQLServerDAL.Search
{
    public class CommonSearch : SQLServerDAL.Base.BaseDAL
    {
        public CommonSearch() {

        }
        public CommonSearch(string dbname)
            : base(dbname)
        {

        }

        public object ExecSelect(string SQL)
        {
            return ExecuteTable(SQL);
        }

        public DataTable ExecSelect(string tableName, SearchCondition cnd)
        {
            string SQL = @" FROM [" + tableName + "]";
            
            return ExecuteTable(SQL, cnd);
        }

        public object ExecScalar(string SQL)
        {
            return ExecuteScalar(SQL);
        }

        public object ExecScalar(string tableName, SearchCondition cnd)
        {
            string SQL = @" FROM [" + tableName + "]";
            return ExecuteScalar(SQL, cnd);
        }

        public object ExecReader(string SQL)
        { 
            return ExecuteReader(SQL);
        }

        public object ExecReader(string tableName, SearchCondition cnd)
        {
            string SQL = @" FROM [" + tableName + "]";

            return ExecuteReader(SQL, cnd);
        }
    }
}
